@import './variables.less';

/* 
    基础样式初始化
 */

// 除去部分元素自带内外边距和边框
.reset-box-model() {
    padding: 0;
    margin: 0;
    border: 0;
}

// 除去列表自带样式
.reset-list-style() {
    list-style: none;
}

// 开启样式全局重置
.global-reset() {
    html,
    body,
    div,
    span,
    applet,
    object,
    iframe,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    blockquote,
    pre,
    a,
    abbr,
    acronym,
    address,
    big,
    cite,
    code,
    del,
    dfn,
    em,
    img,
    ins,
    kbd,
    q,
    s,
    samp,
    small,
    strike,
    strong,
    sub,
    sup,
    tt,
    var,
    dl,
    dt,
    dd,
    ol,
    ul,
    li,
    fieldset,
    form,
    label,
    legend,
    table,
    caption,
    tbody,
    tfoot,
    thead,
    tr,
    th,
    td {
        .reset-box-model();
    }
    ol,
    ul {
        .reset-list-style();
    }
    a {
        text-decoration: none;
    }
}

// 开启移动端样式重置
.reset-mobile() {
    //移动端去除触摸效果
    a,
    button,
    input,
    textarea {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        -webkit-user-modify: read-write-plaintext-only;
        -webkit-appearance: none;
    }
}

// 全局重置时，判断是否进行移动端适配重置
.global-reset() when (@support-html5) {
    .reset-mobile();
}